package cn.njxzc.demo.basm;

import java.util.Scanner;

/**
 * Created by xujia_000 on 3/31/2017.
 */
public class Atm {
     Bank bank;

    Atm() {
        bank = new Bank();

    }

    public static void main(String[] args) {
        Atm atm = new Atm();
        Bank bk=atm.bank;

        boolean firstflag = true;
        int choice1, choice2;//level of menu
        long id;
        String psw;
        while (firstflag) {
            System.out.println("******欢迎使用XXX银行模拟ATM系统，请按如下步骤操作******");
            System.out.println("		  *1.用已有账户登录");
            System.out.println("		  *2.没有账户，开户");
            System.out.println("		  *3.退出");
            Scanner scanner = new Scanner(System.in);
            System.out.println("请选择：");
            try {
                choice1 = scanner.nextInt();
                switch (choice1) {
                    case 1:
                        System.out.println("请输入银行卡号：");
                        scanner=new Scanner(System.in);
                        id=scanner.nextInt();

                        System.out.println("请输入银行卡密码：");
                        psw=scanner.next();
                       // System.out.println(id+psw);

                        break;
                    case 2:
                        System.out.println("开户请携带证件到柜台办理！");
                        break;
                    case 3:
                        bk.saveAccountInfo();
                        firstflag=false;
                        break;
                    default:
                        System.out.println("没有该选项，请重新选择！");
                        break;
                }
            } catch (Exception e) {

            }

        }

    }

}
